package com.ars.common.dao;

import com.ars.common.beans.User.User;
import com.ars.common.utils.DBUtil;

import java.sql.PreparedStatement;
import java.sql.SQLException;

public class Adduser {
    public static void add(User user ) throws SQLException {
        String sql = "INSERT INTO user(userID,`name`,`password`,sex,mailbox,phone) VALUES(?,?,?,?,?,?);";
        PreparedStatement ps = DBUtil.getConnection().prepareStatement(sql);
        ps.setString(1, user.getUserID());
        ps.setString(2, user.getName());
        ps.setString(3, user.getPassword());
        ps.setString(4,user.getSex());
        ps.setString(5,user.getPassword());
        ps.setString(6,user.getPhone());

        ps.execute();

    }
}
